import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
// import reportWebVitals from './reportWebVitals';

// 引入 antd 全局 css 样式
import 'antd/dist/reset.css'

// 导入 history 组件, 包裹根组件
import { BrowserRouter as Router } from 'react-router-dom';

// 导入仓库
import { store, persistor } from '@/store'
//如果使用React,则使用 PersistGate 包裹根组建
import { PersistGate } from 'redux-persist/lib/integration/react';
import { Provider } from 'react-redux'

// ConfigProvider全局化配置
import { ConfigProvider } from 'antd';
import zhCN from 'antd/locale/zh_CN';




const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
  // <React.StrictMode>
  <Provider store={store}>
    <Router>
      <PersistGate loading={null} persistor={persistor}>
        <ConfigProvider locale={zhCN}>
          <App />
        </ConfigProvider>
      </PersistGate>
    </Router>
  </Provider>
  // </React.StrictMode>
);



// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
// reportWebVitals();
